package com.da.javatest.leetCode;

/**
 * @author chenlida
 * @date 2019/1/5 15:11
 * @description
 */
public class Code24 {
    public ListNode swapPairs(ListNode head) {
        if (head != null && head.next != null) {
            int temp = head.val;
            head.val = head.next.val;
            head.next.val = temp;
            swapPairs(head.next.next);
        }
        return head;
    }

}
